<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    input{
      width: 200px;
      height: 200px;
      display: block;
      border: 1px red solid;
    }
  </style>
</head>
<body>
    <input type="button" value="点击显示" onclick="alert('永别了')">
    <input type="button" value="左键单击" id="qaz">
    <input type="button" value="左键双击" id="qaz1">
    <input type="button" value="鼠标按键按下触发" id="qaz2">
    <input type="button" value="鼠标放开触发" id="qaz3">
    <input type="button" value="鼠标元素上移动" id="qaz4">
    <input type="button" value="鼠标移动到元素触发" id="qaz5">
    <input type="button" value="鼠标移出元素时触发" id="qaz6">
    <script>
      // 获取绑定事件的dom对象
      var dianji = document.getElementById("qaz");
      var dianji1 = document.getElementById("qaz1");
      var dianji2 = document.getElementById("qaz2");
      var dianji3 = document.getElementById("qaz3");
      var dianji4 = document.getElementById("qaz4");
      var dianji5 = document.getElementById("qaz5");
      var dianji6 = document.getElementById("qaz6");

      // dianji.onclick = function () {
      //   console.log("asd11111111111111");
      // }
      // 添加绑定事件
      function asss() {
        console.log("asss");
      }
      // 赋值为函数 ，给予的是函数的引用（只写函数的名字，带（）是调用）
      // 左键单击
      dianji.onclick = asss;
      // 左键双击
      dianji1.ondblclick = asss;
      // 鼠标按键按下触发
      dianji2.onmousedown = asss;
      // 鼠标放开触发
      dianji3.onmouseup = asss;
      // 鼠标元素上移动
      dianji4.onmousemove = asss;
      // 鼠标移动到元素触发
      dianji5.onmouseover = asss;
      // 鼠标移出元素时触发
      dianji6.onmouseout = asss;

    </script>
</body>=
</html>